<?php
//占位
trait trait_wss1
{
	//---------------------------------------------------------------------------------------
	function init($ws)
	{
		$this->server = $ws;
	}
	//---------------------------------------------------------------------------------------
	function err($msg, $code = 1)
	{
		$data = ww_format('', $code, $msg);		
		$this->server->push($GLOBALS['CID'], jsone($data));
	}
	//---------------------------------------------------------------------------------------
	function send($v)
	{
		if(is_string($v))
		{
			$v = ww_format($v);
		}
		
		$this->server->push($GLOBALS['CID'], jsone($v));
	}
	//---------------------------------------------------------------------------------------
	function close()
	{
		$this->server->disconnect($GLOBALS['CID']);
	}
}